using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace HRM.Models.Mapping
{
    public class tk_NCTrinhDoMap : EntityTypeConfiguration<tk_NCTrinhDo>
    {
        public tk_NCTrinhDoMap()
        {
            // Primary Key
            this.HasKey(t => t.Id);

            // Properties
            this.Property(t => t.TenKhoaHoc)
                .HasMaxLength(50);

            this.Property(t => t.NoiHoc)
                .HasMaxLength(50);

            this.Property(t => t.MaNV)
                .IsRequired()
                .HasMaxLength(10);

            this.Property(t => t.MaDDKy)
                .IsRequired()
                .HasMaxLength(10);

            this.Property(t => t.MaTKHDHT)
                .IsRequired()
                .HasMaxLength(10);

            // Table & Column Mappings
            this.ToTable("tk_NCTrinhDo");
            this.Property(t => t.Id).HasColumnName("Id");
            this.Property(t => t.TenKhoaHoc).HasColumnName("TenKhoaHoc");
            this.Property(t => t.TgBatDau).HasColumnName("TgBatDau");
            this.Property(t => t.TgKetThuc).HasColumnName("TgKetThuc");
            this.Property(t => t.NoiHoc).HasColumnName("NoiHoc");
            this.Property(t => t.MaNV).HasColumnName("MaNV");
            this.Property(t => t.MaDDKy).HasColumnName("MaDDKy");
            this.Property(t => t.MaTKHDHT).HasColumnName("MaTKHDHT");
        }
    }
}
